package com.java.interview.i设计模式.工厂模式.简单工厂模式;

/**
 * @Description:
 * @Auther: sixbing  QQ:414409451
 * @Date: 2018/12/17 14:45
 */
public class SimpleNoodlesFactory {
    public static final int TYPE_LZ = 1;//兰州拉面
    public static final int TYPE_PM = 2;//泡面
    public static final int TYPE_GK = 3;//干扣面

    public static INoodles createNoodles(int type) {
        switch (type) {
            case TYPE_LZ:
                return new LzNoodles();
            case TYPE_PM:
                return new PaoNoodles();
            case TYPE_GK:
                return new GankouNoodles();
            default:
                return new INoodles() {
                    @Override
                    public void desc() {
                        logi("不吃面 不吃面 不吃面 不吃面 ");
                    }
                };
        }
    }
}
